/* explains Tomcat's default container */
package ex04.pyrmont.startup;

import ex04.pyrmont.core.SimpleContainer;
import org.apache.catalina.connector.http.HttpConnector;


/**
 * connector<br>
 * &nbsp;&nbsp;&nbsp;&nbsp;processors<br>
 * &nbsp;&nbsp;&nbsp;&nbsp;container
 * <p/>
 * 用户发起请求
 * Connector 接收请求<br>
 * 从processor中拿到一个processor，并将这个socket指派给processor处理（assign动作必须立即返回）<br>
 * processor 解析request和response，并调用container处理<br><br>
 * <p/>
 * 为了保证多并发，connector和processor都是在单例线程处理的
 */
public final class Bootstrap {
    public static void main(String[] args) {
        HttpConnector connector = new HttpConnector();
        SimpleContainer container = new SimpleContainer();
        connector.setContainer(container);
        try {
            connector.initialize();
            connector.start();

            // make the application wait until we press any key.
            System.in.read();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}